
package collections.my;

public class SortableElement implements Comparable<SortableElement>
{

	public SortableElement(Long id)
	{
		this.id = id;
	}

	private Long id;

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

	@Override
	public String toString()
	{
		return this.getClass().getSimpleName() + "id=" + getId();
	}

	@Override
	public int compareTo(SortableElement o)
	{
		if (getId() > o.getId())
		{
			return 1;
		}
		else if (getId() < o.getId())
		{
			return -1;

		}
		else
		{
			return 0;
		}

	}

}
